import{User} from '../models/User';
import{Token} from '../models/Token';
import{AuthenticateUser} from '../models/AuthenticateUser';
import{BaseService} from './BaseService';
import{TokensDao} from '../dao/TokensDao';
export class TokensService extends BaseService
{

  tokensDao:TokensDao;
  constructor()
  {
    super();
    this.tokensDao = new TokensDao();
  }

  get(tokenStr:string,callback:Function)
  {
    this.tokensDao.get(tokenStr,(err,token)=>{
      var user:User = undefined;
      if(token)
      {
        user = token.user;
      }
      callback(err,user);
    })
  }
}
